<?xml version="1.0" encoding="UTF-8" ?>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
<%@taglib prefix="p" uri="http://primefaces.prime.com.tr/ui"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<f:view>
	<html xmlns="http://www.w3.org/1999/xhtml"
		xmlns:f="http://java.sun.com/jsf/core"
		xmlns:h="http://java.sun.com/jsf/html"
		xmlns:p="http://primefaces.prime.com.tr/ui">
	<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

	<title><h:outputText value="#{message.mainHeader}" /></title>
	<p:resources />

	<link rel="stylesheet" type="text/css" href="../style.css" />
	<style type="text/css">
.matrix {
	font-family: Lucida Console, Courier, Monotype;
	font-size: 15pt;
	text-align: center;
	width: 12px;
	padding: 0px;
	margin: 0px;
}
</style>
	<script src="../matrix.js" type="text/javascript"></script>

	</head>


	<h:panelGrid columns="2" cellpadding="0" cellspacing="0"
		style="width:100%;text-align:center;">
		<h:outputLabel value="#{message.mainTitle}"
			style="background-image:url('../images/gcc.png');" />
		<h:outputLabel value="#{message.mainTitle}" />
	</h:panelGrid>


	<body>
	<center><h:panelGrid width="900" border="0" columns="3">
		<h:panelGroup style="width: %70;">
			<h:graphicImage value="../images/dunya.png"></h:graphicImage>
		</h:panelGroup>
		<h:panelGroup>
			<div id="matrix">SANAL KITAPLIK</div>
		</h:panelGroup>
		<h:panelGroup>
			<div><h:graphicImage value="../images/books_worm.png"></h:graphicImage></div>
		</h:panelGroup>
	</h:panelGrid> <h:panelGrid width="900" border="0" columns="1">
		<h:panelGroup>
			<h:form>
				<p:menubar>
					<p:submenu label="Ana Sayfa">
					</p:submenu>
					<p:submenu label="Kitaplar">
						<p:menuitem value="Çok Satanlar"></p:menuitem>
						<p:menuitem value="Yeni Eklenenler"></p:menuitem>
						<p:menuitem value="Acil olanlar"></p:menuitem>
					</p:submenu>
					<p:submenu label="Ders Notları">
						<p:menuitem value="Çok Satanlar"></p:menuitem>
						<p:menuitem value="Yeni Eklenenler"></p:menuitem>
					</p:submenu>
					<p:submenu label="Kullanıcı Görüşleri">
						<p:menuitem value="ddde"></p:menuitem>
					</p:submenu>
				</p:menubar>
			</h:form>
		</h:panelGroup>
	</h:panelGrid> <h:panelGrid width="900" border="0" columns="1"
		style="background-image:url('../images/seffaf.png');text-align:center;">
		<h:panelGroup style="margin: 100px;">
				ÜYE KAYIT FORMU
				<h:form id="userRegistrationForm"
				style="margin-left: auto; margin-right: auto;">

				<h:panelGroup rendered="#{UserRegistrationBean.success == false}">

					<h:panelGrid columns="1">

						<h:panelGrid columns="1">
							<h:outputText value="#{message.userNameFieldErrorMessage}"
								rendered="#{UserRegistrationBean.errorUserName}"
								style="color:red;" />
							<h:outputText value="#{message.passwordFieldErrorMessage}"
								rendered="#{UserRegistrationBean.errorPassword}"
								style="color:red;" />
							<h:outputText value="#{message.emailFieldErrorMessage}"
								rendered="#{UserRegistrationBean.errorEmail}" style="color:red;" />
							<h:outputText value="#{message.firstnameFieldErrorMessage}"
								rendered="#{UserRegistrationBean.errorFirstname}"
								style="color:red;" />
							<h:outputText value="#{message.lastnameFieldErrorMessage}"
								rendered="#{UserRegistrationBean.errorLastname}"
								style="color:red;" />
						</h:panelGrid>

						<h:panelGrid columns="2">
							<h:outputText value="Kullanıcı Adı: *" style="align:left;" />
							<h:inputText label="UserName"
								value="#{UserRegistrationBean.userRegistration.userName}"
								style="width:100%;" />

							<h:outputText value="Şifre: *" />
							<p:password
								value="#{UserRegistrationBean.userRegistration.password}"
								promptLabel="Lütfen şifre giriniz" weakLabel="Zayıf"
								goodLabel="Orta seviye" strongLabel="Güçlü" minLength="6"
								maxlength="20" style="width:100%;" />
							<h:outputText value="Şifre (tekrar):* " />
							<p:password
								value="#{UserRegistrationBean.userRegistration.passwordCheck}"
								promptLabel="Lütfen şifre giriniz" weakLabel="Zayıf"
								goodLabel="Orta seviye" strongLabel="Güçlü" minLength="6"
								maxlength="20" style="width:100%;" />

							<h:outputText value="Email :*" />
							<h:panelGrid columns="2" style="width:100%;">
								<h:inputText required="true" label="EmailAcountName"
									value="#{UserRegistrationBean.userRegistration.emailAccountName}"
									style="width:100%;" />
								<h:outputLabel
									value="@#{UserRegistrationBean.userRegistration.emailHostAddress}" />
							</h:panelGrid>

							<h:outputText value="Email (tekrar) :*" />
							<h:panelGrid columns="2" style="width:100%;">
								<h:inputText required="true" label="EmailAcountNameCheck"
									value="#{UserRegistrationBean.userRegistration.emailAccountNameCheck}"
									style="width:100%;" />
								<h:outputLabel
									value="@#{UserRegistrationBean.userRegistration.emailHostAddress}" />
							</h:panelGrid>

							<h:outputText value="İsim: *" />
							<h:inputText required="true" label="FirstName"
								value="#{UserRegistrationBean.userRegistration.firstName}"
								style="width:100%;" />

							<h:outputText value="Soyisim: *" />
							<h:inputText required="true" label="LastName"
								value="#{UserRegistrationBean.userRegistration.lastName}"
								style="width:100%;" />

							<h:outputText value="Kullanıcı tipi:" />
							<h:selectOneMenu
								value="#{UserRegistrationBean.userRegistration.userRoleName}"
								valueChangeListener="#{UserRegistrationBean.userRegistration.changeUserRole}"
								immediate="true" onchange="submit()" style="width:100%;">
								<f:selectItems value="#{UserRegistrationBean.userRoles}" />
							</h:selectOneMenu>
						</h:panelGrid>


						<h:panelGroup
							rendered="#{UserRegistrationBean.userRegistration.roleCode == 0}">
							<h:panelGrid columns="2">
								<h:outputText value="Year: *" />
								<h:selectOneMenu
									value="#{UserRegistrationBean.userRegistration.userRole.year}"
									style="width:100%;">
									<f:selectItem itemLabel="Year" itemValue="" />
									<f:selectItem itemLabel="Hazirlik" itemValue="Hazirlik" />
									<f:selectItem itemLabel="1.Sinif" itemValue="1.Sinif" />
									<f:selectItem itemLabel="2.Sinif" itemValue="2.Sinif" />
									<f:selectItem itemLabel="3.Sinif" itemValue="3.Sinif" />
									<f:selectItem itemLabel="4.Sinif" itemValue="4.Sinif" />
								</h:selectOneMenu>

								<h:outputText value="Major: *" />
								<h:selectOneMenu
									value="#{UserRegistrationBean.userRegistration.userRole.major}"
									style="width:100%;">
									<f:selectItem itemLabel="Major" itemValue="" />
									<f:selectItem itemLabel="Bilgisayar Muhendisligi"
										itemValue="Bilgisayar Muhendisligi" />
									<f:selectItem itemLabel="Endustri Muhendisligi"
										itemValue="Endustri Muhendisligi" />
									<f:selectItem itemLabel="Elektrik Muhendisligi"
										itemValue="Elektrik Muhendisligi" />
								</h:selectOneMenu>
							</h:panelGrid>
						</h:panelGroup>
						<h:panelGroup
							rendered="#{UserRegistrationBean.userRegistration.roleCode == 1}">
							<h:panelGrid columns="2">
								<h:outputText value="Bölüm: *" />
								<h:selectOneMenu
									value="#{UserRegistrationBean.userRegistration.userRole.department}"
									style="width:100%;">
									<f:selectItem itemLabel="Department" itemValue="" />
									<f:selectItem itemLabel="Bilgisayar Muhendisligi"
										itemValue="Bilgisayar Muhendisligi" />
									<f:selectItem itemLabel="Endustri Muhendisligi"
										itemValue="Endustri Muhendisligi" />
									<f:selectItem itemLabel="Elektrik Muhendisligi"
										itemValue="Elektrik Muhendisligi" />
								</h:selectOneMenu>



								<h:outputText value="Degree: *" />
								<h:selectOneMenu
									value="#{UserRegistrationBean.userRegistration.userRole.degree}"
									style="width:100%;">
									<f:selectItem itemLabel="Degree" itemValue="" />
									<f:selectItem itemLabel="Profesor" itemValue="Profesor" />
									<f:selectItem itemLabel="Docent" itemValue="Docent" />

								</h:selectOneMenu>

							</h:panelGrid>
						</h:panelGroup>
						<p:commandButton id="register"
							action="#{UserRegistrationBean.register}"
							value="#{message.registerButton}" ajax="false" async="false"
							style="margin-left: 100px" />
					</h:panelGrid>
				</h:panelGroup>
				<h:panelGroup rendered="#{UserRegistrationBean.success}">
					<h:panelGrid columns="1">
						<h:outputText value="#{message.registrationSuccessfulMessage}" />
					</h:panelGrid>
				</h:panelGroup>
			</h:form>
		</h:panelGroup>
	</h:panelGrid> <p:dock>
		<p:menuitem icon="/images/books.png" url="#" />
		<p:menuitem icon="/images/books.png" url="#" />
		<p:menuitem icon="/images/books.png" url="#" />
		<p:menuitem icon="/images/books.png" url="#" />
		<p:menuitem icon="/images/books.png" url="#" />
		<p:menuitem icon="/images/books.png" url="#" />
	</p:dock> <p:stack icon="/images/stack.png">
		<p:menuitem value="book" icon="/images/book.png" url="#" />
		<p:menuitem value="Favoriler" icon="/images/yildiz.png" url="#" />
		<p:menuitem value="CD" icon="/images/cd.png" url="#" />
		<p:menuitem value="NOTLAR" icon="/images/notebook.png" url="#" />
		<p:menuitem value="KİTAPLAR" icon="/images/book.png" url="#" />
	</p:stack></center>
	</body>
	</html>
</f:view>

